import greenfoot.*;  // (World, Actor, GreenfootImage, Greenfoot and MouseInfo)

/**
 * Class that contains subclasses deathly to the Player, it has a method that al the subclasses share.
 * 
 * @author Manuel Nava
 * @version 1.0
 */
public class Trap extends Actor
{
    /**
     * The method act is empty.
     */
    public void act() 
    {
        // Add your action code here.
    }    
    
    /**
     * Move the objects in the world as long as the scroll is actived.
     */
    public void move()
    {
       if(((CaveWorld)(getWorld())).getCont()>0)
       {
        if(Greenfoot.isKeyDown("left")&&((CaveWorld)(getWorld())).getMove()==true)
            setLocation(getX()+5,getY());
        if(Greenfoot.isKeyDown("right")&&((CaveWorld)(getWorld())).getMove()==true)
            setLocation(getX()-5,getY());
        }
    }
}
